/*
 * This file is part of DALS - Distributed Artificial Life Simulation.
 * DALS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Foobar is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with DALS.  If not, see <http://www.gnu.org/licenses/>.
 */
/*
 * GlobalDataView.java
 *
 * Created on 21/11/2010, 19:28:49
 */
package world.view;

/**
 *
 * @author romulo
 */
public class GlobalDataView extends javax.swing.JFrame {

    /** Creates new form GlobalDataView */
    public GlobalDataView() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelTotalEnvironment = new javax.swing.JLabel();
        jLabelTotalIndividual = new javax.swing.JLabel();
        jLabelTotalFood = new javax.swing.JLabel();
        jLabelEnvironmentValue = new javax.swing.JLabel();
        jLabelIndividualValue = new javax.swing.JLabel();
        jLabelFoodValue = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabelTotalEnvironment.setText("Total de ecossistemas:");

        jLabelTotalIndividual.setText("Total de indivíduos:");

        jLabelTotalFood.setText("Total de alimentos:");

        jLabelEnvironmentValue.setText("0");

        jLabelIndividualValue.setText("0");

        jLabelFoodValue.setText("0");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelTotalEnvironment)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelEnvironmentValue))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelTotalIndividual)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelIndividualValue))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelTotalFood)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelFoodValue)))
                .addContainerGap(208, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalEnvironment)
                    .addComponent(jLabelEnvironmentValue))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalIndividual)
                    .addComponent(jLabelIndividualValue))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalFood)
                    .addComponent(jLabelFoodValue))
                .addContainerGap(210, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new GlobalDataView().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabelEnvironmentValue;
    private javax.swing.JLabel jLabelFoodValue;
    private javax.swing.JLabel jLabelIndividualValue;
    private javax.swing.JLabel jLabelTotalEnvironment;
    private javax.swing.JLabel jLabelTotalFood;
    private javax.swing.JLabel jLabelTotalIndividual;
    // End of variables declaration//GEN-END:variables

    /**
     * Updates the labels that displays statistics
     * @param environments
     * @param foods
     * @param individuals
     */
    public void updateStatistcs(int environments, int foods, int individuals) {
        jLabelEnvironmentValue.setText(environments + "");
        jLabelFoodValue.setText(foods + "");
        jLabelIndividualValue.setText(individuals + "");
    }
}
